<?php 

 namespace app\article\validate;

 use think\Validate;

 class Comment extends Validate
 {
    /**
     * 规则
     * @var [type]
     */
    protected $rule = [
        'id' => 'require|integer',
        'pid|父级评论信息' => 'require|integer',
        'article_id|文章信息' => 'require|integer',
        'content' => 'require',
        'username|用户名' => 'require',
        'avatar|用户头像' => 'require',
    ];

    /**
     * 验证场景
     * @var [type]
     */
    protected $scene =[
        'create' => ['pid','article_id','content','username','avatar'],
        'del' => ['id'],
    ];

 }